package org.fage.semples.model;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "exam_subject")
public class ExamSubject implements Serializable {

	private static final long serialVersionUID = 682509653743627723L;

	@Id
	@Column(name = "sub_id",nullable = false)
	private String subId;
	
	@Column(name = "name", length = 45, nullable = false)
	private String name;
	
	@Column(name = "description", length = 225, nullable = false)
	private String description;
	
	@Column(name = "test_count", nullable = false)
	private int testCount;
	
	@Column(name = "total_time", nullable = false)
	private int totalTime;
	
	@Column(name = "total_score", nullable = false)
	private String totalScore;
	
	@Column(name = "status", length = 1, nullable = false)
	private String status;
	
	@OneToMany(mappedBy = "examSubject")
	private Set<ExamTest> examTest;
	
	@OneToMany(mappedBy = "examSubject")
	private Set<ExamUserSubject> examUserSubject;
	
	public ExamSubject(){
		super();
	}
	
	public ExamSubject(String subId, String name, String description, int testCount, int totalTime, String totalScore, String status){
		super();
		this.subId = subId;
		this.name = name;
		this.description = description;
		this.testCount = testCount;
		this.totalTime = totalTime;
		this.totalScore = totalScore;
		this.status = status;
	}

	public Set<ExamTest> getExamTest() {
		return examTest;
	}

	public void setExamTest(Set<ExamTest> examTest) {
		this.examTest = examTest;
	}

	public Set<ExamUserSubject> getExamUserSubject() {
		return examUserSubject;
	}

	public void setExamUserSubject(Set<ExamUserSubject> examUserSubject) {
		this.examUserSubject = examUserSubject;
	}

	public String getSubId() {
		return subId;
	}

	public void setSubId(String subId) {
		this.subId = subId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getTestCount() {
		return testCount;
	}

	public void setTestCount(int testCount) {
		this.testCount = testCount;
	}

	public int getTotalTime() {
		return totalTime;
	}

	public void setTotalTime(int totalTime) {
		this.totalTime = totalTime;
	}

	public String getTotalScore() {
		return totalScore;
	}

	public void setTotalScore(String totalScore) {
		this.totalScore = totalScore;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
}
